﻿using NUnit.Framework;
using AdventureWorks.DataAccess.repository;
namespace AdventureWorks.DataAccess.Test.repository
{
    [TestFixture]
    public class PersonRepositoryUpdateTest : RepositoryTestBase<PersonRepository>
    {
        [Test]
        public void Add_Email_Test()
        {
            var person = repository.GetPersonById(session, 1);
            Assert.AreEqual(1, person.Emails.Count);
            person.Emails.Add("g@gmail.com");
            repository.SavePerson(session, person);
            session.Flush();
            var newPerson = repository.GetPersonById(session, 1);
            Assert.AreEqual(2, newPerson.Emails.Count);
        }
    }
}
